home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interapplication Communication / AE Interfaces / CIncludes / AppleEvents.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-08  |  28.8 KB  |  740 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AppleEvents.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __APPLEEVENTS__
  13. #define __APPLEEVENTS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __MEMORY__
  23. #include <Memory.h>
  24. #endif
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. /*    #include <Quickdraw.h>                                        */
  33. /*        #include <QuickdrawText.h>                                */
  34. /*            #include <IntlResources.h>                            */
  35. #endif
  36.  
  37. #ifndef __EPPC__
  38. #include <EPPC.h>
  39. /*    #include <PPCToolBox.h>                                        */
  40. /*        #include <AppleTalk.h>                                    */
  41. /*    #include <Processes.h>                                        */
  42. /*        #include <Files.h>                                        */
  43. /*            #include <SegLoad.h>                                */
  44. #endif
  45.  
  46. #ifndef __NOTIFICATION__
  47. #include <Notification.h>
  48. #endif
  49.  
  50. #define typeBoolean 'bool'
  51.  
  52. #define typeChar 'TEXT'
  53.  
  54. #define typeSMInt 'shor'
  55.  
  56. #define typeInteger 'long'
  57.  
  58. #define typeSMFloat 'sing'
  59.  
  60. #define typeFloat 'doub'
  61.  
  62. #define typeLongInteger 'long'
  63.  
  64. #define typeShortInteger 'shor'
  65.  
  66. #define typeLongFloat 'doub'
  67.  
  68. #define typeShortFloat 'sing'
  69.  
  70. #define typeExtended 'exte'
  71.  
  72. #define typeComp 'comp'
  73.  
  74. #define typeMagnitude 'magn'
  75.  
  76. #define typeAEList 'list'
  77.  
  78. #define typeAERecord 'reco'
  79.  
  80. #define typeAppleEvent 'aevt'
  81.  
  82. #define typeTrue 'true'
  83.  
  84. #define typeFalse 'fals'
  85.  
  86. #define typeAlias 'alis'
  87.  
  88. #define typeEnumerated 'enum'
  89.  
  90. #define typeType 'type'
  91.  
  92. #define typeAppParameters 'appa'
  93.  
  94. #define typeProperty 'prop'
  95.  
  96. #define typeFSS 'fss '
  97.  
  98. #define typeKeyword 'keyw'
  99.  
  100. #define typeSectionH 'sect'
  101.  
  102. #define typeWildCard '****'
  103.  
  104. #define typeApplSignature 'sign'
  105.  
  106. #define typeSessionID 'ssid'
  107.  
  108. #define typeTargetID 'targ'
  109.  
  110. #define typeProcessSerialNumber 'psn '
  111.  
  112. #define typeNull 'null'
  113.  
  114. #define keyDirectObject '----'
  115.  
  116. #define keyErrorNumber 'errn'
  117.  
  118. #define keyErrorString 'errs'
  119.  
  120. #define keyProcessSerialNumber 'psn '
  121.  
  122. #define keyTransactionIDAttr 'tran'
  123.  
  124. #define keyReturnIDAttr 'rtid'
  125.  
  126. #define keyEventClassAttr 'evcl'
  127.  
  128. #define keyEventIDAttr 'evid'
  129.  
  130. #define keyAddressAttr 'addr'
  131.  
  132. #define keyOptionalKeywordAttr 'optk'
  133.  
  134. #define keyTimeoutAttr 'timo'
  135.  
  136. #define keyInteractLevelAttr 'inte'
  137.  
  138. #define keyEventSourceAttr 'esrc'
  139.  
  140. #define keyMissedKeywordAttr 'miss'
  141.  
  142. #define keyOriginalAddressAttr 'from'
  143.  
  144. #define keyPreDispatch 'phac'
  145.  
  146. #define keySelectProc 'selh'
  147.  
  148. #define keyAERecorderCount 'recr'
  149.  
  150. #define keyAEVersion 'vers'
  151.  
  152. #define kCoreEventClass 'aevt'
  153.  
  154. #define kAEOpenApplication 'oapp'
  155.  
  156. #define kAEOpenDocuments 'odoc'
  157.  
  158. #define kAEPrintDocuments 'pdoc'
  159.  
  160. #define kAEQuitApplication 'quit'
  161.  
  162. #define kAEAnswer 'ansr'
  163.  
  164. #define kAEApplicationDied 'obit'
  165.  
  166. enum  {
  167.     kAENoReply                    = 0x00000001,                    /* sender doesn't want a reply to event */
  168.     kAEQueueReply                = 0x00000002,                    /* sender wants a reply but won't wait */
  169.     kAEWaitReply                = 0x00000003,                    /* sender wants a reply and will wait */
  170.     kAENeverInteract            = 0x00000010,                    /* server should not interact with user */
  171.     kAECanInteract                = 0x00000020,                    /* server may try to interact with user */
  172.     kAEAlwaysInteract            = 0x00000030,                    /* server should always interact with user where appropriate */
  173.     kAECanSwitchLayer            = 0x00000040,                    /* interaction may switch layer */
  174.     kAEDontReconnect            = 0x00000080,                    /* don't reconnect if there is a sessClosedErr from PPCToolbox */
  175.     kAEWantReceipt                = nReturnReceipt,                /* sender wants a receipt of message */
  176.     kAEDontRecord                = 0x00001000,                    /* don't record this event - available only in vers 1.0.1 and greater */
  177.     kAEDontExecute                = 0x00002000,                    /* don't send the event for recording - available only in vers 1.0.1 and greater */
  178. /*--------------------------------------------------------------
  179.         Constants for the send priority in AESend
  180. --------------------------------------------------------------*/
  181.     kAENormalPriority            = 0x00000000,                    /* post message at the end of the event queue */
  182.     kAEHighPriority                = nAttnMsg                        /* post message at the front of the event queue */
  183. };
  184.  
  185.  
  186. /*--------------------------------------------------------------
  187.         Constants for recording
  188. --------------------------------------------------------------*/
  189.  
  190. #define kAEStartRecording 'reca'
  191.  
  192. #define kAEStopRecording 'recc'
  193.  
  194. #define kAENotifyStartRecording 'rec1'
  195.  
  196. #define kAENotifyStopRecording 'rec0'
  197.  
  198. #define kAENotifyRecording 'recr'
  199.  
  200. enum  {
  201.     kAutoGenerateReturnID        = -1,                            /* AECreateAppleEvent will generate a session-unique ID */
  202. /*--------------------------------------------------------------
  203.         Constant for transaction ID's
  204. --------------------------------------------------------------*/
  205.     kAnyTransactionID            = 0,                            /* no transaction is in use */
  206. /*--------------------------------------------------------------
  207.         Constants for timeout durations
  208. --------------------------------------------------------------*/
  209.     kAEDefaultTimeout            = -1,                            /* timeout value determined by AEM */
  210.     kNoTimeOut                    = -2                            /* wait until reply comes back, however long it takes */
  211. };
  212.  
  213.  
  214. /*--------------------------------------------------------------
  215.         Constants for AEResumeTheCurrentEvent
  216. --------------------------------------------------------------*/
  217.  
  218. enum  {
  219.     kAENoDispatch                = 0,                            /* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch */
  220.     kAEUseStandardDispatch        = 0xFFFFFFFF,                    /* table, or one of these two constants */
  221. /*--------------------------------------------------------------
  222.         Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch
  223. --------------------------------------------------------------*/
  224.     kAEDoNotIgnoreHandler        = 0x00000000,
  225.     kAEIgnoreAppPhacHandler        = 0x00000001,                    /* available only in vers 1.0.1 and greater */
  226.     kAEIgnoreAppEventHandler    = 0x00000002,                    /* available only in vers 1.0.1 and greater */
  227.     kAEIgnoreSysPhacHandler        = 0x00000004,                    /* available only in vers 1.0.1 and greater */
  228.     kAEIgnoreSysEventHandler    = 0x00000008,                    /* available only in vers 1.0.1 and greater */
  229.     kAEIngoreBuiltInEventHandler = 0x00000010,                    /* available only in vers 1.0.1 and greater */
  230.     kAEDontDisposeOnResume        = 0x80000000                    /* available only in vers 1.0.1 and greater */
  231. };
  232.  
  233.  
  234. /*--------------------------------------------------------------
  235.         Apple event manager data types
  236. --------------------------------------------------------------*/
  237.  
  238. typedef unsigned long AEEventClass;
  239.  
  240. typedef unsigned long AEEventID;
  241.  
  242. typedef unsigned long AEKeyword;
  243.  
  244. typedef ResType DescType;
  245.  
  246. #if defined(powerc) || defined (__powerc)
  247. #pragma options align=mac68k
  248. #endif
  249. struct AEDesc {
  250.     DescType                    descriptorType;
  251.     Handle                        dataHandle;
  252. };
  253. #if defined(powerc) || defined(__powerc)
  254. #pragma options align=reset
  255. #endif
  256.  
  257. typedef struct AEDesc AEDesc;
  258.  
  259. #if defined(powerc) || defined (__powerc)
  260. #pragma options align=mac68k
  261. #endif
  262. struct AEKeyDesc {
  263.     AEKeyword                    descKey;
  264.     AEDesc                        descContent;
  265. };
  266. #if defined(powerc) || defined(__powerc)
  267. #pragma options align=reset
  268. #endif
  269.  
  270. typedef struct AEKeyDesc AEKeyDesc;
  271.  
  272.  
  273. /* an AEDesc which contains address data */
  274.  
  275. typedef AEDesc AEAddressDesc;
  276.  
  277.  
  278. /* a list of AEDesc's is a special kind of AEDesc */
  279.  
  280. typedef AEDesc AEDescList;
  281.  
  282.  
  283. /* AERecord is a list of keyworded AEDesc's */
  284.  
  285. typedef AEDescList AERecord;
  286.  
  287.  
  288. /* an AERecord that contains an AppleEvent */
  289.  
  290. typedef AERecord AppleEvent;
  291.  
  292.  
  293. /* parameter to AESend */
  294.  
  295. typedef long AESendMode;
  296.  
  297.  
  298. /* priority param of AESend */
  299.  
  300. typedef short AESendPriority;
  301.  
  302. enum  {
  303.     kAEInteractWithSelf,
  304.     kAEInteractWithLocal,
  305.     kAEInteractWithAll
  306. };
  307.  
  308. typedef unsigned char AEInteractAllowed;
  309.  
  310. enum  {
  311.     kAEUnknownSource,
  312.     kAEDirectCall,
  313.     kAESameProcess,
  314.     kAELocalProcess,
  315.     kAERemoteProcess
  316. };
  317.  
  318. typedef unsigned char AEEventSource;
  319.  
  320. enum  {
  321.     kAEDataArray,
  322.     kAEPackedArray,
  323.     kAEHandleArray,
  324.     kAEDescArray,
  325.     kAEKeyDescArray
  326. };
  327.  
  328. typedef unsigned char AEArrayType;
  329.  
  330. #if defined(powerc) || defined (__powerc)
  331. #pragma options align=mac68k
  332. #endif
  333. union AEArrayData {
  334.     short                        kAEDataArray[1];
  335.     char                        kAEPackedArray[1];
  336.     Handle                        kAEHandleArray[1];
  337.     AEDesc                        kAEDescArray[1];
  338.     AEKeyDesc                    kAEKeyDescArray[1];
  339. };
  340. #if defined(powerc) || defined(__powerc)
  341. #pragma options align=reset
  342. #endif
  343.  
  344. typedef union AEArrayData AEArrayData;
  345.  
  346. typedef AEArrayData *AEArrayDataPointer;
  347.  
  348. typedef pascal Boolean (*AEIdleProcPtr)(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
  349.  
  350. enum {
  351.     uppAEIdleProcInfo = kPascalStackBased
  352.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  353.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventRecord*)))
  354.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long*)))
  355.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(RgnHandle*)))
  356. };
  357.  
  358. #if USESROUTINEDESCRIPTORS
  359. typedef UniversalProcPtr AEIdleUPP;
  360.  
  361. #define CallAEIdleProc(userRoutine, theEvent, sleepTime, mouseRgn)        \
  362.         CallUniversalProc((UniversalProcPtr)userRoutine, uppAEIdleProcInfo, theEvent, sleepTime, mouseRgn)
  363. #define NewAEIdleProc(userRoutine)        \
  364.         (AEIdleUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppAEIdleProcInfo, GetCurrentISA())
  365. #else
  366. typedef AEIdleProcPtr AEIdleUPP;
  367.  
  368. #define CallAEIdleProc(userRoutine, theEvent, sleepTime, mouseRgn)        \
  369.         (*userRoutine)(theEvent, sleepTime, mouseRgn)
  370. #define NewAEIdleProc(userRoutine)        \
  371.         (AEIdleUPP)(userRoutine)
  372. #endif
  373.  
  374. typedef pascal Boolean (*AEFilterProcPtr)(EventRecord *theEvent, long returnID, long transactionID, const AEAddressDesc *sender);
  375.  
  376. enum {
  377.     uppAEFilterProcInfo = kPascalStackBased
  378.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  379.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EventRecord*)))
  380.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  381.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  382.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AEAddressDesc*)))
  383. };
  384.  
  385. #if USESROUTINEDESCRIPTORS
  386. typedef UniversalProcPtr AEFilterUPP;
  387.  
  388. #define CallAEFilterProc(userRoutine, theEvent, returnID, transactionID, sender)        \
  389.         CallUniversalProc((UniversalProcPtr)userRoutine, uppAEFilterProcInfo, theEvent, returnID, transactionID, sender)
  390. #define NewAEFilterProc(userRoutine)        \
  391.         (AEFilterUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppAEFilterProcInfo, GetCurrentISA())
  392. #else
  393. typedef AEFilterProcPtr AEFilterUPP;
  394.  
  395. #define CallAEFilterProc(userRoutine, theEvent, returnID, transactionID, sender)        \
  396.         (*userRoutine)(theEvent, returnID, transactionID, sender)
  397. #define NewAEFilterProc(userRoutine)        \
  398.         (AEFilterUPP)(userRoutine)
  399. #endif
  400.  
  401. typedef pascal OSErr (*AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
  402.  
  403. enum {
  404.     uppAEEventHandlerProcInfo = kPascalStackBased
  405.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  406.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AppleEvent*)))
  407.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AppleEvent*)))
  408.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  409. };
  410.  
  411. #if USESROUTINEDESCRIPTORS
  412. typedef UniversalProcPtr AEEventHandlerUPP;
  413.  
  414. #define CallAEEventHandlerProc(userRoutine, theAppleEvent, reply, handlerRefcon)        \
  415.         CallUniversalProc((UniversalProcPtr)userRoutine, uppAEEventHandlerProcInfo, theAppleEvent, reply, handlerRefcon)
  416. #define NewAEEventHandlerProc(userRoutine)        \
  417.         (AEEventHandlerUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppAEEventHandlerProcInfo, GetCurrentISA())
  418. #else
  419. typedef AEEventHandlerProcPtr AEEventHandlerUPP;
  420.  
  421. #define CallAEEventHandlerProc(userRoutine, theAppleEvent, reply, handlerRefcon)        \
  422.         (*userRoutine)(theAppleEvent, reply, handlerRefcon)
  423. #define NewAEEventHandlerProc(userRoutine)        \
  424.         (AEEventHandlerUPP)(userRoutine)
  425. #endif
  426.  
  427. typedef pascal OSErr (*AECoerceDescProcPtr)(const AEDesc *fromDesc, DescType toType, long handlerRefcon, AEDesc *toDesc);
  428.  
  429. enum {
  430.     uppAECoerceDescProcInfo = kPascalStackBased
  431.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  432.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AEDesc*)))
  433.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DescType)))
  434.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  435.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AEDesc*)))
  436. };
  437.  
  438. #if USESROUTINEDESCRIPTORS
  439. typedef UniversalProcPtr AECoerceDescUPP;
  440.  
  441. #define CallAECoerceDescProc(userRoutine, fromDesc, toType, handlerRefcon, toDesc)        \
  442.         CallUniversalProc((UniversalProcPtr)userRoutine, uppAECoerceDescProcInfo, fromDesc, toType, handlerRefcon, toDesc)
  443. #define NewAECoerceDescProc(userRoutine)        \
  444.         (AECoerceDescUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppAECoerceDescProcInfo, GetCurrentISA())
  445. #else
  446. typedef AECoerceDescProcPtr AECoerceDescUPP;
  447.  
  448. #define CallAECoerceDescProc(userRoutine, fromDesc, toType, handlerRefcon, toDesc)        \
  449.         (*userRoutine)(fromDesc, toType, handlerRefcon, toDesc)
  450. #define NewAECoerceDescProc(userRoutine)        \
  451.         (AECoerceDescUPP)(userRoutine)
  452. #endif
  453.  
  454. typedef pascal OSErr (*AECoercePtrProcPtr)(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, long handlerRefcon, AEDesc *result);
  455.  
  456. enum {
  457.     uppAECoercePtrProcInfo = kPascalStackBased
  458.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  459.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DescType)))
  460.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  461.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Size)))
  462.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DescType)))
  463.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  464.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(AEDesc*)))
  465. };
  466.  
  467. #if USESROUTINEDESCRIPTORS
  468. typedef UniversalProcPtr AECoercePtrUPP;
  469.  
  470. #define CallAECoercePtrProc(userRoutine, typeCode, dataPtr, dataSize, toType, handlerRefcon, result)        \
  471.         CallUniversalProc((UniversalProcPtr)userRoutine, uppAECoercePtrProcInfo, typeCode, dataPtr, dataSize, toType, handlerRefcon, result)
  472. #define NewAECoercePtrProc(userRoutine)        \
  473.         (AECoercePtrUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppAECoercePtrProcInfo, GetCurrentISA())
  474. #else
  475. typedef AECoercePtrProcPtr AECoercePtrUPP;
  476.  
  477. #define CallAECoercePtrProc(userRoutine, typeCode, dataPtr, dataSize, toType, handlerRefcon, result)        \
  478.         (*userRoutine)(typeCode, dataPtr, dataSize, toType, handlerRefcon, result)
  479. #define NewAECoercePtrProc(userRoutine)        \
  480.         (AECoercePtrUPP)(userRoutine)
  481. #endif
  482.  
  483. typedef UniversalProcPtr AECoercionHandlerUPP;
  484.  
  485.  
  486. /*--------------------------------------------------------------
  487.         Apple event manager error messages
  488. --------------------------------------------------------------*/
  489.  
  490. enum  {
  491.     errAECoercionFail            = -1700,                        /* bad parameter data or unable to coerce the data supplied */
  492.     errAEDescNotFound            = -1701,
  493.     errAECorruptData            = -1702,
  494.     errAEWrongDataType            = -1703,
  495.     errAENotAEDesc                = -1704,
  496.     errAEBadListItem            = -1705,                        /* the specified list item does not exist */
  497.     errAENewerVersion            = -1706,                        /* need newer version of the AppleEvent manager */
  498.     errAENotAppleEvent            = -1707,                        /* the event is not in AppleEvent format */
  499.     errAEEventNotHandled        = -1708,                        /* the AppleEvent was not handled by any handler */
  500.     errAEReplyNotValid            = -1709,                        /* AEResetTimer was passed an invalid reply parameter */
  501.     errAEUnknownSendMode        = -1710,                        /* mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown */
  502.     errAEWaitCanceled            = -1711,                        /* in AESend, the user cancelled out of wait loop for reply or receipt */
  503.     errAETimeout                = -1712,                        /* the AppleEvent timed out */
  504.     errAENoUserInteraction        = -1713,                        /* no user interaction is allowed */
  505.     errAENotASpecialFunction    = -1714,                        /* there is no special function for/with this keyword */
  506.     errAEParamMissed            = -1715,                        /* a required parameter was not accessed */
  507.     errAEUnknownAddressType        = -1716,                        /* the target address type is not known */
  508.     errAEHandlerNotFound        = -1717,                        /* no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler */
  509.     errAEReplyNotArrived        = -1718                            /* the contents of the reply you are accessing have not arrived yet */
  510. };
  511.  
  512. enum  {
  513.     errAEIllegalIndex            = -1719,                        /* index is out of range in a put operation */
  514.     errAEUnknownObjectType        = -1731,                        /* available only in version 1.0.1 or greater */
  515.     errAERecordingIsAlreadyOn    = -1732                            /* available only in version 1.0.1 or greater */
  516. };
  517.  
  518. #ifdef __cplusplus
  519. extern "C" {
  520. #endif
  521.  
  522. extern pascal OSErr AECreateDesc(DescType typeCode, const void *dataPtr, Size dataSize, AEDesc *result)
  523.  THREEWORDINLINE(0x303C, 0x0825, 0xA816);
  524. extern pascal OSErr AECoercePtr(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, AEDesc *result)
  525.  THREEWORDINLINE(0x303C, 0x0A02, 0xA816);
  526. extern pascal OSErr AECoerceDesc(const AEDesc *theAEDesc, DescType toType, AEDesc *result)
  527.  THREEWORDINLINE(0x303C, 0x0603, 0xA816);
  528. extern pascal OSErr AEDisposeDesc(AEDesc *theAEDesc)
  529.  THREEWORDINLINE(0x303C, 0x0204, 0xA816);
  530. extern pascal OSErr AEDuplicateDesc(const AEDesc *theAEDesc, AEDesc *result)
  531.  THREEWORDINLINE(0x303C, 0x0405, 0xA816);
  532.  
  533. /**************************************************************************
  534.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  535.   AEDesc, the calls in the previous section can also be used for AEDescList.
  536.   All list and array indices are 1-based. If the data was greater than
  537.   maximumSize in the routines below, then actualSize will be greater than
  538.   maximumSize, but only maximumSize bytes will actually be retrieved.
  539. **************************************************************************/
  540.  
  541. extern pascal OSErr AECreateList(const void *factoringPtr, Size factoredSize, Boolean isRecord, AEDescList *resultList)
  542.  THREEWORDINLINE(0x303C, 0x0706, 0xA816);
  543. extern pascal OSErr AECountItems(const AEDescList *theAEDescList, long *theCount)
  544.  THREEWORDINLINE(0x303C, 0x0407, 0xA816);
  545. extern pascal OSErr AEPutPtr(const AEDescList *theAEDescList, long index, DescType typeCode, const void *dataPtr, Size dataSize)
  546.  THREEWORDINLINE(0x303C, 0x0A08, 0xA816);
  547. extern pascal OSErr AEPutDesc(const AEDescList *theAEDescList, long index, const AEDesc *theAEDesc)
  548.  THREEWORDINLINE(0x303C, 0x0609, 0xA816);
  549. extern pascal OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  550.  THREEWORDINLINE(0x303C, 0x100A, 0xA816);
  551. extern pascal OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, AEDesc *result)
  552.  THREEWORDINLINE(0x303C, 0x0A0B, 0xA816);
  553. extern pascal OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode, Size *dataSize)
  554.  THREEWORDINLINE(0x303C, 0x082A, 0xA816);
  555. extern pascal OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType, AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType, Size *itemSize, long *itemCount)
  556.  THREEWORDINLINE(0x303C, 0x0D0C, 0xA816);
  557. extern pascal OSErr AEPutArray(const AEDescList *theAEDescList, AEArrayType arrayType, const AEArrayData *arrayPtr, DescType itemType, Size itemSize, long itemCount)
  558.  THREEWORDINLINE(0x303C, 0x0B0D, 0xA816);
  559. extern pascal OSErr AEDeleteItem(const AEDescList *theAEDescList, long index)
  560.  THREEWORDINLINE(0x303C, 0x040E, 0xA816);
  561.  
  562. /**************************************************************************
  563.  The following calls apply to AERecord. Since AERecord is a subtype of
  564.  AEDescList, the calls in the previous sections can also be used for
  565.  AERecord an AERecord can be created by using AECreateList with isRecord
  566.  set to true. 
  567.  
  568.  NOTE: These calls are duplicately named, so their implementation has
  569.  been changed to a macro which calls the duplicate function.
  570. **************************************************************************/
  571.  
  572. #define AEPutKeyPtr(theAERecord, theAEKeyword, typeCode, dataPtr, dataSize)  \
  573.     AEPutParamPtr((theAERecord), (theAEKeyword), (typeCode), (dataPtr), (dataSize))
  574.  
  575. #define AEPutKeyDesc(theAERecord, theAEKeyword, theAEDesc)  \
  576.     AEPutParamDesc((theAERecord), (theAEKeyword), (theAEDesc))
  577.  
  578. #define AEGetKeyPtr(theAERecord, theAEKeyword, desiredType, typeCode, dataPtr, maxSize, actualSize)  \
  579.     AEGetParamPtr((theAERecord), (theAEKeyword), (desiredType), (typeCode), (dataPtr), (maxSize), (actualSize))
  580.  
  581. #define AEGetKeyDesc(theAERecord, theAEKeyword, desiredType, result)  \
  582.     AEGetParamDesc((theAERecord), (theAEKeyword), (desiredType), (result))
  583.  
  584. #define AESizeOfKeyDesc(theAERecord, theAEKeyword, typeCode, dataSize)  \
  585.     AESizeOfParam((theAERecord), (theAEKeyword), (typeCode), (dataSize))
  586.  
  587. #define AEDeleteKeyDesc(theAERecord, theAEKeyword)  \
  588.     AEDeleteParam((theAERecord), (theAEKeyword))
  589.  
  590. extern pascal OSErr AEPutParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  591.  THREEWORDINLINE(0x303C, 0x0A0F, 0xA816);
  592. extern pascal OSErr AEPutParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  593.  THREEWORDINLINE(0x303C, 0x0610, 0xA816);
  594. extern pascal OSErr AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  595.  THREEWORDINLINE(0x303C, 0x0E11, 0xA816);
  596. extern pascal OSErr AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  597.  THREEWORDINLINE(0x303C, 0x0812, 0xA816);
  598. extern pascal OSErr AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  599.  THREEWORDINLINE(0x303C, 0x0829, 0xA816);
  600. extern pascal OSErr AEDeleteParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword)
  601.  THREEWORDINLINE(0x303C, 0x0413, 0xA816);
  602.  
  603. /**************************************************************************
  604.  The following calls also apply to type AppleEvent. Message attributes are
  605.  far more restricted, and can only be accessed through the following 5
  606.  calls. The various list and record routines cannot be used to access the
  607.  attributes of an event. 
  608. **************************************************************************/
  609.  
  610. extern pascal OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
  611.  THREEWORDINLINE(0x303C, 0x0E15, 0xA816);
  612. extern pascal OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
  613.  THREEWORDINLINE(0x303C, 0x0826, 0xA816);
  614. extern pascal OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
  615.  THREEWORDINLINE(0x303C, 0x0828, 0xA816);
  616. extern pascal OSErr AEPutAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
  617.  THREEWORDINLINE(0x303C, 0x0A16, 0xA816);
  618. extern pascal OSErr AEPutAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
  619.  THREEWORDINLINE(0x303C, 0x0627, 0xA816);
  620.  
  621. /**************************************************************************
  622.   The next couple of calls are basic routines used to create, send,
  623.   and process AppleEvents. 
  624. **************************************************************************/
  625.  
  626. extern pascal OSErr AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result)
  627.  THREEWORDINLINE(0x303C, 0x0B14, 0xA816);
  628. extern pascal OSErr AESend(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
  629.  THREEWORDINLINE(0x303C, 0x0D17, 0xA816);
  630. extern pascal OSErr AEProcessAppleEvent(const EventRecord *theEventRecord)
  631.  THREEWORDINLINE(0x303C, 0x021B, 0xA816);
  632.  
  633. /* 
  634.  Note: during event processing, an event handler may realize that it is likely
  635.  to exceed the client's timeout limit. Passing the reply to this
  636.  routine causes a wait event to be generated that asks the client
  637.  for more time. 
  638. */
  639.  
  640. extern pascal OSErr AEResetTimer(const AppleEvent *reply)
  641.  THREEWORDINLINE(0x303C, 0x0219, 0xA816);
  642.  
  643. /**************************************************************************
  644.  The following four calls are available for applications which need more
  645.  sophisticated control over when and how events are processed. Applications
  646.  which implement multi-session servers or which implement their own
  647.  internal event queueing will probably be the major clients of these
  648.  routines. They can be called from within a handler to prevent the AEM from
  649.  disposing of the AppleEvent when the handler returns. They can be used to
  650.  asynchronously process the event (as MacApp does).
  651. **************************************************************************/
  652.  
  653. extern pascal OSErr AESuspendTheCurrentEvent(const AppleEvent *theAppleEvent)
  654.  THREEWORDINLINE(0x303C, 0x022B, 0xA816);
  655.  
  656. /* 
  657.  Note: The following routine tells the AppleEvent manager that processing
  658.  is either about to resume or has been completed on a previously suspended
  659.  event. The procPtr passed in as the dispatcher parameter will be called to
  660.  attempt to redispatch the event. Several constants for the dispatcher
  661.  parameter allow special behavior. They are:
  662.       - kAEUseStandardDispatch means redispatch as if the event was just
  663.       received, using the standard AppleEvent dispatch mechanism.
  664.       - kAENoDispatch means ignore the parameter.
  665.          Use this in the case where the event has been handled and no
  666.       redispatch is needed.
  667.       - non nil means call the routine which the dispatcher points to.
  668. */
  669.  
  670. extern pascal OSErr AEResumeTheCurrentEvent(const AppleEvent *theAppleEvent, const AppleEvent *reply, AEEventHandlerUPP dispatcher, long handlerRefcon)
  671.  THREEWORDINLINE(0x303C, 0x0818, 0xA816);
  672. extern pascal OSErr AEGetTheCurrentEvent(AppleEvent *theAppleEvent)
  673.  THREEWORDINLINE(0x303C, 0x021A, 0xA816);
  674. extern pascal OSErr AESetTheCurrentEvent(const AppleEvent *theAppleEvent)
  675.  THREEWORDINLINE(0x303C, 0x022C, 0xA816);
  676.  
  677. /**************************************************************************
  678.   The following three calls are used to allow applications to behave
  679.   courteously when a user interaction such as a dialog box is needed. 
  680. **************************************************************************/
  681.  
  682. extern pascal OSErr AEGetInteractionAllowed(AEInteractAllowed *level)
  683.  THREEWORDINLINE(0x303C, 0x021D, 0xA816);
  684. extern pascal OSErr AESetInteractionAllowed(AEInteractAllowed level)
  685.  THREEWORDINLINE(0x303C, 0x011E, 0xA816);
  686. extern pascal OSErr AEInteractWithUser(long timeOutInTicks, NMRecPtr nmReqPtr, AEIdleUPP idleProc)
  687.  THREEWORDINLINE(0x303C, 0x061C, 0xA816);
  688.  
  689. /**************************************************************************
  690.   These calls are used to set up and modify the event dispatch table.
  691. **************************************************************************/
  692.  
  693. extern pascal OSErr AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, long handlerRefcon, Boolean isSysHandler)
  694.  THREEWORDINLINE(0x303C, 0x091F, 0xA816);
  695. extern pascal OSErr AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, Boolean isSysHandler)
  696.  THREEWORDINLINE(0x303C, 0x0720, 0xA816);
  697. extern pascal OSErr AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP *handler, long *handlerRefcon, Boolean isSysHandler)
  698.  THREEWORDINLINE(0x303C, 0x0921, 0xA816);
  699.  
  700. /**************************************************************************
  701.   These calls are used to set up and modify the coercion dispatch table.
  702. **************************************************************************/
  703.  
  704. extern pascal OSErr AEInstallCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, long handlerRefcon, Boolean fromTypeIsDesc, Boolean isSysHandler)
  705.  THREEWORDINLINE(0x303C, 0x0A22, 0xA816);
  706. extern pascal OSErr AERemoveCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, Boolean isSysHandler)
  707.  THREEWORDINLINE(0x303C, 0x0723, 0xA816);
  708. extern pascal OSErr AEGetCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP *handler, long *handlerRefcon, Boolean *fromTypeIsDesc, Boolean isSysHandler)
  709.  THREEWORDINLINE(0x303C, 0x0B24, 0xA816);
  710.  
  711. /**************************************************************************
  712.   These calls are used to set up and modify special hooks into the
  713.   AppleEvent manager.
  714. **************************************************************************/
  715.  
  716. extern pascal OSErr AEInstallSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  717.  THREEWORDINLINE(0x303C, 0x0500, 0xA816);
  718. extern pascal OSErr AERemoveSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
  719.  THREEWORDINLINE(0x303C, 0x0501, 0xA816);
  720. extern pascal OSErr AEGetSpecialHandler(AEKeyword functionClass, UniversalProcPtr *handler, Boolean isSysHandler)
  721.  THREEWORDINLINE(0x303C, 0x052D, 0xA816);
  722.  
  723. /**************************************************************************
  724.   This call was added in version 1.0.1. If called with the keyword
  725.   keyAERecorderCount ('recr'), the number of recorders that are
  726.   currently active is returned in 'result'.
  727. **************************************************************************/
  728.  
  729.  
  730. /* available only in vers 1.0.1 and greater */
  731.  
  732. extern pascal OSErr AEManagerInfo(AEKeyword keyWord, long *result)
  733.  THREEWORDINLINE(0x303C, 0x0441, 0xA816);
  734. #ifdef __cplusplus
  735. }
  736. #endif
  737.  
  738. #endif
  739.  
  740.